<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
use app\middleware\CheckClientSign;
use app\middleware\CheckUserToken;

Route::group('v1', function () {

    # 公共路由
    Route::group(function () {
        // 系统登陆相关
        Route::post('login', 'v1.Publics/login');         # 账户密码登录
        Route::post('wxlogin', 'v1.Publics/wxlogin');     # 微信扫码登录
        Route::get('logout', 'v1.Publics/logout')->middleware(CheckUserToken::class); # 退出登录

    });

    # 老师端
    Route::group(function () {

        // 首页 - 待办事项管理
        Route::get('todo-list', 'v1.TodoList/index');        # 获取所有待办事项
        Route::get('todo-list-del', 'v1.TodoList/delete');   # 删除指定事项
        Route::post('todo-list', 'v1.TodoList/create');      # 新增事项
        Route::get('todo-list-edit', 'v1.TodoList/edit');    # 修改事项状态

        // 学生管理
        Route::get('students', 'v1.Student/index');     # 学员列表
        

        // 课程管理
        Route::get('courses', 'v1.Course/index');    # 获取所有课程

        // 阶段管理
        Route::get('stage', 'v1.Stage/index');            # 获取所有阶段课程
        Route::get('stage-create', 'v1.Stage/create');    # 新增阶段
        Route::get('stage-read', 'v1.Stage/read');        # 获取某个阶段下课程

        // 阶段周期管理
        Route::post('weekCourse', 'v1.WeekCourse/create');             # 新增周期
        Route::get('weekCourse-edit', 'v1.WeekCourse/edit');           # 修改周期
        Route::get('weekCourse-del', 'v1.WeekCourse/delete');          # 删除周期
        Route::post('weekCourse-update/:id', 'v1.WeekCourse/update');  # 编辑周期课程


        // 周期章节管理
        Route::get('chapter', 'v1.Chapter/index');                  # 获取章节
        Route::get('chapter-edit', 'v1.Chapter/editStatus');        # 修改章节状态
        Route::post('chapter-edit/:id', 'v1.Chapter/editTitle');    # 修改章节标题
        Route::get('chapter-del', 'v1.Chapter/delete');             # 删除章节
        Route::post('chapter-create', 'v1.Chapter/create');         # 增加章节
        Route::get('chapter-read', 'v1.Chapter/read');              # 获取章节小节

        // 文章小节管理
        Route::get('section','v1.Section/index');             # 获取小节内容
        Route::get('section-del','v1.Section/delete');        # 删除小节
        Route::post('section', 'v1.Section/create');          # 增加小节
        Route::post('section-update', 'v1.Section/update');   # 修改小节

        //课程教师概述
        Route::get('summarize','v1.Summarize/index');   # 获取教师概述

        //学生管理 
        Route::get('studentManagement','v1.StudentManagement/index');             # 获取学生信息
        Route::get('native','v1.Native/index');                                   # 获取所有籍贯
        Route::post('studentManagement', 'v1.StudentManagement/create');          # 增加学员信息
        Route::post('studentManagement-search', 'v1.StudentManagement/search');   # 搜索学员信息
        Route::post('studentManagement-update','v1.StudentManagement/update');    # 编辑学生信息
        Route::get('studentManagement-delete','v1.StudentManagement/delete');     # 删除学生信息
        Route::get('studentManagement-read','v1.StudentManagement/read');         # 获取学生详细信息
        Route::get('semester','v1.Semester/index');                               # 获取所有学期
        Route::get('province','v1.Province/index');                               # 获取所有省
        Route::get('city','v1.City/index');                                       # 获取所有市
        //面包屑
        Route::get('branchNode','v1.BranchNode/index');   //获取父级id

        //来源信息
        Route::get('source','v1.Source/index');   //获取所有来源
    });

    # 学员端
    Route::group(function () {
        Route::get('StudentInformation','v1.Presentation/lookup');
        Route::post('uerAdded','v1.Presentation/UerAdded');


        // 首页 - 待办事项管理
        Route::get('stu-todo-list', 'v1.StuTodoList/index');        # 获取所有待办事项
        Route::get('todo-list-del', 'v1.TodoList/delete');          # 删除指定事项
        Route::post('stu-todo-list', 'v1.StuTodoList/create');      # 新增事项
        Route::get('todo-list-edit', 'v1.TodoList/edit');           # 修改事项状态

        //我的课程
        Route::get('stu-course', 'v1.StuCourse/index');         # 获取课程
        Route::get('stu-course-read', 'v1.StuCourse/read');     # 获取周期阶段章节
        Route::get('stu-course-get', 'v1.StuCourse/get');       # 获取单个阶段下课程
        Route::get('chapter-read', 'v1.Chapter/read');          # 获取章节小节
        Route::get('section','v1.Section/index');               # 获取小节内容
    });

});
